package com.example.demo.pojo.entity;

import com.example.demo.controller.ValidateGroup;
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.time.LocalDateTime;

@Getter
@Setter
@ToString
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public class Report {
    private Long id;

    @NotNull(groups = ValidateGroup.ItemReport.class, message = "被举报的商品不能为空")
    private Long itemId;

    @NotNull(groups = ValidateGroup.CommentReport.class, message = "被举报的评论不能为空")
    private Long commentId;

    @NotBlank(groups = ValidateGroup.Report.class, message = "举报原因不能为空")
    private String reason;

    private String image;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    public Report() {
    }

    public Report(Long id, Long itemId, Long commentId, String reason, String image, LocalDateTime createTime, LocalDateTime updateTime) {
        this.id = id;
        this.itemId = itemId;
        this.commentId = commentId;
        this.reason = reason;
        this.image = image;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }
}
